//
//  JWRobot.m
//  KotH
//
//  Created by James Weatherley on 19/08/2008.
//  Copyright 2008 James Weatherley. All rights reserved.
//

#import "../koth.h"


@implementation JWRobot

@synthesize selected;
@synthesize square;



#pragma mark Protocol
-(id)initWithSquare:(JWSquare*)square_
{
	self = [super init];
	
	square = square_;
	[square setRobot:self];
	selected = NO;
	
	return self;
}

-(NSObject<JWManager>*)manager
{
	return [[JWManagers sharedManager] managerOfClass:[JWRobotManager class]];
}

+(NSInteger)energy
{
	return 3;
}

#pragma mark Implementation
-(float)height
{
	float height = [square height];
	if([square topBox]) {
		height += [[square topBox] heightAboveSquare] + 1.0;
	}
	return height;
}

@end
